﻿<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:local="using:Notepads.Controls">

    <ResourceDictionary.ThemeDictionaries>
        <ResourceDictionary x:Key="Default" />
        <ResourceDictionary x:Key="Light">
            <SolidColorBrush x:Key="MarkdownBorderBrush" Color="#FFBEBEBE" />
            <SolidColorBrush x:Key="MarkdownBackgroundBrush" Color="#FFF6F8FA" />
            <SolidColorBrush x:Key="MarkdownInlineCodeBackgroundBrush" Color="#FFDDDFE1" />
            <SolidColorBrush x:Key="MarkdownInlineCodeForegroundBrush" Color="#FF6E6F70" />
            <SolidColorBrush x:Key="MarkdownQuoteForeground" Color="#FF6E747C" />
            <SolidColorBrush x:Key="MarkdownRichTextBlockBackground" Color="#FFF6F8FA" />
        </ResourceDictionary>
        <ResourceDictionary x:Key="Dark">
            <SolidColorBrush x:Key="MarkdownBorderBrush" Color="#FF424242" />
            <SolidColorBrush x:Key="MarkdownBackgroundBrush" Color="#FF202020" />
            <SolidColorBrush x:Key="MarkdownInlineCodeBackgroundBrush" Color="#FF363636" />
            <SolidColorBrush x:Key="MarkdownInlineCodeForegroundBrush" Color="#FFB7B4B4" />
            <SolidColorBrush x:Key="MarkdownQuoteForeground" Color="#FFBEC1C5" />
            <SolidColorBrush x:Key="MarkdownRichTextBlockBackground" Color="#FF202020" />
        </ResourceDictionary>
        <ResourceDictionary x:Key="HighContrast">
            <SolidColorBrush x:Key="MarkdownBorderBrush" Color="#FF424242" />
            <SolidColorBrush x:Key="MarkdownBackgroundBrush" Color="#FF202020" />
            <SolidColorBrush x:Key="MarkdownInlineCodeBackgroundBrush" Color="#FF363636" />
            <SolidColorBrush x:Key="MarkdownInlineCodeForegroundBrush" Color="#FFB7B4B4" />
            <SolidColorBrush x:Key="MarkdownQuoteForeground" Color="#FFBEC1C5" />
            <SolidColorBrush x:Key="MarkdownRichTextBlockBackground" Color="{ThemeResource SystemColorWindowColor}" />
        </ResourceDictionary>
    </ResourceDictionary.ThemeDictionaries>

   
    <Style TargetType="local:MarkdownTextBlock">
        <Setter Property="Background" Value="{ThemeResource MarkdownRichTextBlockBackground}" />
        <Setter Property="IsTabStop" Value="False" />
        <Setter Property="LinkForeground" Value="{ThemeResource SystemColorHotlightColor}" />
        <Setter Property="QuoteBackground" Value="Transparent" />
        <Setter Property="QuoteForeground" Value="{ThemeResource MarkdownQuoteForeground}" />
        <Setter Property="QuoteBorderBrush" Value="{ThemeResource MarkdownBorderBrush}" />
        <Setter Property="QuoteBorderThickness" Value="2, 0, 0, 0" />
        <Setter Property="QuoteMargin" Value="7, 5, 0, 5" />
        <Setter Property="QuotePadding" Value="7, 2, 0, 4" />
        <Setter Property="CodeBackground" Value="{ThemeResource MarkdownBackgroundBrush}" />
        <Setter Property="CodeBorderBrush" Value="{ThemeResource MarkdownBorderBrush}" />
        <Setter Property="CodeBorderThickness" Value="0" />
        <Setter Property="InlineCodeBorderThickness" Value="0" />
        <Setter Property="InlineCodePadding" Value="4, 2, 4, 2" />
        <Setter Property="InlineCodeMargin" Value="2,0,2,-4"/>
        <Setter Property="InlineCodeBackground" Value="{ThemeResource MarkdownInlineCodeBackgroundBrush}" />
        <Setter Property="InlineCodeBorderBrush" Value="{ThemeResource MarkdownBorderBrush}" />
        <Setter Property="InlineCodeForeground" Value="{ThemeResource MarkdownInlineCodeForegroundBrush}" />
        <Setter Property="CodeFontFamily" Value="Consolas" />
        <Setter Property="CodeMargin" Value="0, 7, 0, 7" />
        <Setter Property="CodePadding" Value="10, 6, 10, 6" />
        <Setter Property="EmojiFontFamily" Value="Segoe UI Emoji" />
        <Setter Property="Header1FontWeight" Value="Bold" />
        <Setter Property="Header1FontSize" Value="20" />
        <Setter Property="Header1Margin" Value="0, 15, 0, 15" />
        <Setter Property="Header1Foreground" Value="{ThemeResource DefaultTextForegroundThemeBrush}" />
        <Setter Property="Header2FontWeight" Value="Normal" />
        <Setter Property="Header2FontSize" Value="20" />
        <Setter Property="Header2Margin" Value="0, 15, 0, 15" />
        <Setter Property="Header2Foreground" Value="{ThemeResource DefaultTextForegroundThemeBrush}" />
        <Setter Property="Header3FontWeight" Value="Bold" />
        <Setter Property="Header3FontSize" Value="17" />
        <Setter Property="Header3Margin" Value="0, 10, 0, 10" />
        <Setter Property="Header3Foreground" Value="{ThemeResource DefaultTextForegroundThemeBrush}" />
        <Setter Property="Header4FontWeight" Value="Normal" />
        <Setter Property="Header4FontSize" Value="17" />
        <Setter Property="Header4Margin" Value="0, 10, 0, 10" />
        <Setter Property="Header4Foreground" Value="{ThemeResource DefaultTextForegroundThemeBrush}" />
        <Setter Property="Header5FontWeight" Value="Bold" />
        <Setter Property="Header5FontSize" Value="15" />
        <Setter Property="Header5Margin" Value="0, 10, 0, 5" />
        <Setter Property="Header5Foreground" Value="{ThemeResource DefaultTextForegroundThemeBrush}" />
        <Setter Property="Header6FontWeight" Value="Normal" />
        <Setter Property="Header6FontSize" Value="15" />
        <Setter Property="Header6Margin" Value="0, 10, 0, 0" />
        <Setter Property="Header6Foreground" Value="{ThemeResource DefaultTextForegroundThemeBrush}" />
        <Setter Property="HorizontalRuleBrush" Value="{ThemeResource MarkdownBorderBrush}" />
        <Setter Property="HorizontalRuleMargin" Value="0, 7, 0, 7" />
        <Setter Property="HorizontalRuleThickness" Value="2" />
        <Setter Property="ListMargin" Value="0, 5, 0, 5" />
        <Setter Property="ListGutterWidth" Value="32" />
        <Setter Property="ListBulletSpacing" Value="8" />
        <Setter Property="ParagraphMargin" Value="0, 5, 0, 5" />
        <Setter Property="ParagraphLineHeight" Value="20" />
        <Setter Property="TableBorderBrush" Value="{ThemeResource MarkdownBorderBrush}" />
        <Setter Property="TableBorderThickness" Value="1" />
        <Setter Property="TableCellPadding" Value="9, 4, 9, 4" />
        <Setter Property="YamlBorderThickness" Value="1" />
        <Setter Property="YamlBorderBrush" Value="{ThemeResource MarkdownBorderBrush}" />
        <Setter Property="TableMargin" Value="0, 5, 0, 5" />
        <Setter Property="TextWrapping" Value="Wrap" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="local:MarkdownTextBlock">
                    <Border x:Name="RootElement"
                            Background="{TemplateBinding Background}"
                            BorderBrush="{TemplateBinding BorderBrush}"
                            BorderThickness="{TemplateBinding BorderThickness}" />
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
</ResourceDictionary>